package com.yungam.common.bean.alarm;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yungam.common.bean.user.User;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@Accessors(chain = true)
@TableName("alarm")
public class AlarmDto {

    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer alarmId;
    private Integer itemId;
    private String equipName;
    @TableField("`ip`")
    private String ip;
    private Long timestamp;
    @TableField("`name`")
    private String name;
    @TableField("`count`")
    private Integer count;
    @TableField("`max`")
    private Double max;
    @TableField("`min`")
    private Double min;
    private String reason;
    @TableField("`group`")
    private String group;
    private Integer level;
    @TableField("`state`")
    private Integer state;
    private Integer operatorId;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date operateTime;

    @TableField(exist = false)
    private User operator;

}
